function foo(x) {
  if (x === 1) {
    //1.抛出基本数据类型
    // throw 'this is a error'
    //2.抛出对象类型、自定义类对象
    //3.node自带一个Error
    const err = new Error('check this error..')
    console.log(err)
    throw new Error('x can not be 1')
  }
  return x
}

console.log(foo(2))
foo(1)
